package cn.sccl.common.scheduler;

import cn.sccl.common.scheduler.enums.JobStateEnum;
import cn.sccl.common.scheduler.model.TaskFireLog;
import cn.sccl.common.scheduler.model.TaskParams;
import cn.sccl.common.scheduler.service.TaskFireLogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author _minus
 * @create 2017-10-08 14:18
 */

@Service(value = "testService")
public class TestService {

    @Autowired
    private TaskFireLogManager taskFireLogManager;
    public void testJob(TaskParams params){

        String logId = params.getFireLogId() ;
        System.out.println("任务日志id为:"+logId);
        TaskFireLog log = taskFireLogManager.get(logId);

        log.setStatus(JobStateEnum.TASK_RUNNING.getCode().toString());

        taskFireLogManager.save(log);

    }
}
